import requests
import os

pathDir = map(lambda x: x[:-3].upper() + 'xml.gz', filter(lambda a: a.endswith("pdb"), os.listdir("../../../PDB/")))
for i in pathDir:
    with open("../../../PDB/" + i, "wb") as xml:
        xml.write(requests.get("http://files.rcsb.org/download/" + i).content)


